// moa获取gps
export const getGPS = (label, index, scanCodeInfo) => {
  imp.iGps.getInfo((gps) => {
    //  this.lonLat = "维度:" + gps.latitude + ";经度:" + gps.longitude
    scanCodeInfo(label, index, gps.latitude, gps.longitude);
  });
};
// 距离超出限制
export const exceedDistance = (
  { distance, standardDistance, controlModeType },
  label,
  index,
  latitude,
  longitude,
  scanCodeInfo
) => {
  if (controlModeType === "1") {
    // 强制距离判断
    uni.showModal({
      title: "温馨提示",
      content: `您与站址间的距离为${distance}m，已超出地市规定${standardDistance}m的最大距离，将退出本次的到货确认`,
      showCancel: false,
      confirmColor: '#eb4b4b',
    });
  } else if (controlModeType === "2") {
    // 非强制与地市关联
    uni.showModal({
      title: "温馨提示",
      content: `您与站址间的距离为${distance}m，已超出地市规定${standardDistance}m的最大距离，是否继续进行到货确认`,
      confirmColor: '#eb4b4b',
      success: (res) => {
        scanCodeInfo(label, index, latitude, longitude, 1);
      },
    });
  }else{
    console.log("345")
  }
};
